<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsprintsetup 测试,firefox必须安装jsprintsetup插件</title>

<style type="text/css">
* {
	margin: 0;
	padding: 0;
	font-size: 12px;
	line-height: 25px;
}

#loginBox {
	width: 500px;
	border: 1px solid #ccc;
	background: #FFF;
}

h1 {
	height: 35px;
	line-height: 35px;
	background: #e8e8e8;
	font-size: 14px;
	border-bottom: 1px solid #ccc;
	text-indent: 5px;
}

html,body {
	border: 0px solid #333333;
	color: #333333;
	font: 12px/150% Arial, Helvetica, sans-serif, '宋体';
	margin: 0;
	padding: 0;
	font-family: Arial, Tahoma, Verdana, sans-serif;
	font-size: 12px;
}
</style>
<script type="text/javascript" src="./jquery.min.js"></script>
<script type="text/javascript" src="./jquery.cookie.js"></script>
<script type="text/javascript" src="./jsprint.js"></script>
<script type="text/javascript">

	$(function(){
		printerSetup();//打印机设置
		//alert(winW+" "+winH);
	});

	//打印测试
	function ajaxPrint(type){
		/*
		$.get('/jsprint/ajax.php?type='+type,function(html){		
			var  pwin=window.open("a.html","print",'height=800, width=850, top=-200, left=-200, toolbar=no, menubar=no, scrollbars=yes,resizable=yes');   
		 	pwin.document.write(html);   
		  	pwin.document.close();             //这句很重要哦  
		},"html");
		 */
		$.ajax({
			url : '/jsprint/ajax.php?type=' + type,
			type : 'POST',
			data : {},
			cache : false,
			dataType : "html",
			success : function(html){
				//自动打印
				openPrint(html,type);
			}
		});
	}
	//打印测试
	function labelPrint(type){
		/*
		$.get('/jsprint/ajax.php?type='+type,function(html){		
			var  pwin=window.open("a.html","print",'height=800, width=850, top=-200, left=-200, toolbar=no, menubar=no, scrollbars=yes,resizable=yes');   
		 	pwin.document.write(html);   
		  	pwin.document.close();             //这句很重要哦  
		},"html");
		 */
		$.ajax({
			url : '/jsprint/label.php?type=' + type,
			type : 'POST',
			data : {},
			cache : false,
			dataType : "html",
			success : function(html){
				//自动打印				
				openPrint(html,type);
			}
		});
	}
	
	//打印测试
	function multiPrint(){
		/*
		$.get('/jsprint/ajax.php?type='+type,function(html){		
			var  pwin=window.open("a.html","print",'height=800, width=850, top=-200, left=-200, toolbar=no, menubar=no, scrollbars=yes,resizable=yes');   
		 	pwin.document.write(html);   
		  	pwin.document.close();             //这句很重要哦  
		},"html");
		 */
		$.ajax({
			url : '/jsprint/label.php?type=A4',
			type : 'POST',
			data : {},
			cache : false,
			dataType : "html",
			success : function(html){
				//自动打印				
				openPrint(html,'A4');
				setTimeout(function(){
					$.ajax({
						url : '/jsprint/ajax.php?type=10x10',
						type : 'POST',
						data : {},
						cache : false,
						dataType : "html",
						success : function(html1){
							//自动打印				
							openPrint(html1,'10x10');
							
						}
					});
				},5000);
				
			}
		});
	}
	
	
	
</script>
</head>
<body>
	<div style="text-align: center; float: left; margin-left: 5px;">


		<div id="loginBox" style="text-align: left">
			<h1>打印机设置</h1>
			<div id="msg"
				style="margin-top: 5px; margin-left: 5px; font-size: 13px; color: red; text-align: center;">
				<span></span>
			</div>
			<div id="printerWrap"></div>
			<p align="center">
				<input type="button" value="保存" class="" onclick="savePrinter()" />
				<br /> <br /> <br /> <br />
				<h1>打印测试</h1>
				<p align="center">
					<input type="button" value="A4" class=""
						onclick="ajaxPrint('A4')" />&nbsp;&nbsp; 
						<input type="button"
						value="10x10" class="" onclick="ajaxPrint('10x10')" />
						&nbsp;&nbsp; 
						<input type="button"
						value="label10x10" class="" onclick="labelPrint('10x10')" />
						&nbsp;&nbsp; 
						<input type="button"
						value="labelA4" class="" onclick="labelPrint('A4')" />
						&nbsp;&nbsp; 
						<input type="button"
						value="dialogPrint" class="" onclick="dialogPrint('/jsprint/ajax.php?type=10x10','10x10')" />
						&nbsp;&nbsp; 
						<input type="button"
						value="multiPrint" class="" onclick="multiPrint()" />
				</p>
		</div>
		<div id='iframeWrap' style='width: 300px; overflow: hidden;'></div>


	</div>
</body>
</html>